<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Set" %>
<%@ page import="utils.string.session.SessionStringUtil" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="vo.TableFix" %>
<%@ page import="utils.string.date.DateToStringUtil" %><%--
  Created by IntelliJ IDEA.
  User: Chris
  Date: 2021/5/10
  Time: 22:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>欢迎${sessionScope.User.user_name}用户查看本用户下修理中设备</title>
</head>
<body>
<h2>欢迎${sessionScope.User.user_name}查看本用户修理的设备情况</h2><br>
<%
    HashMap userFixs = (HashMap)session.getAttribute(SessionStringUtil.USER_FIXS);
    System.out.println("allTableFix=" + userFixs);
%>
<table border="1">
    <tr bgcolor="pink">
        <td>修理编号</td>
        <td>设备名称</td>
        <td>申请人</td>
        <td>数目</td>
        <td>保修问题</td>
        <td>时间</td>
    </tr>
        <%
        Set set = userFixs.keySet();
        Iterator ite = set.iterator();
        while(ite.hasNext()){
            int fixId = (int)ite.next();
            TableFix fix = (TableFix) userFixs.get(fixId);
            String date = DateToStringUtil.DateToString(fix.getFix_date());
    %>
    <tr bgcolor="yellow">
        <td><%=fix.getEquip_id()%></td>
        <td><%=fix.getEquip_name()%></td>
        <td><%=fix.getUser_name()%></td>
        <td><%=fix.getFix_num()%></td>
        <td><%=fix.getFix_reason()%></td>
        <td><%=date%></td>
    </tr>
    <%} %>
</table>
    <a href="servlet/AddEquipmentServlet" methods="get">返回查看所有可使用的设备情况</a><br>
</body>
</html>
